<template>
	<view>
		<view class="mainpadding2">
			<!-- <view class="mainpadding_top radius" style="background-color: #f6f6f6;" v-for="item in list.data" :key="item.id">
				<view class="sanshier hei_text bold">{{item.title}}</view>
				<view class="xiaohui margin_top2 ershil">{{item.createtime_text}}</view>
				<view class="xiaohei margin_top ershiba">{{item.des}}</view>
			</view> -->
			<view class="flexbetween margin_top" v-for="item in list.data" :key="item.id" @click="jumpzhuye(item.user_id)">
			<!-- <view class="flexbetween margin_top" v-for="item in list.data" :key="item.id" @click="shipin(item.hddata.id,item.hddata.user_id)"> -->
				<view class="flexleft">
					<image class="margin_right3" :src="item.user.avatar_text" style="border-radius: 50%;min-width: 110rpx;width: 110rpx;height: 110rpx;" mode=""></image>
					<view class="">
						<view class="sanshier hei_text bold">{{item.user.nickname}}</view>
						<view class="xiankuan" style="display: flex;" v-if="item.hd_type==2">
							<view style="display: flex;" class="xiankuan">
								<view v-for="(ite,ind) in item.memo_text" :key="ind">
									<!-- <u-tooltip :text="it.value" :buttons="['撤回']" :showCopy="false" :overlay="false" @click="backMsg(ite)" v-show="it.type==1"></u-tooltip> -->
									<text v-show="ite.type=='text'">{{ite.value}}</text>
									<image v-if="ite.type=='emoji'" style="width: 40rpx;height: 40rpx;top:6rpx;"
										:src="'../static/emojis/qq/'+ite.attrs.src+''" mode=""
										></image>
								</view>
							</view>
						</view>
						<view class="xiaohui sanshi xiankuan margin_top1" v-else>{{item.memo}}</view>
						<view class="xiaohui smalltext margin_top1">{{item.createtime_text}}</view>
					</view>
				</view>
				<image :src="item.hddata.video_url_text+'?x-oss-process=video/snapshot,t_10000,m_fast'" mode="" style="border-radius: 10rpx;min-width: 140rpx;width: 140rpx;height: 140rpx;"></image>
			</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				page: 1,
				limit: 12,
				list: {
					data: []
				},
			}
		},
		onLoad() {
			this.init()
		},
		methods: {
			shipin(id,userid){
				uni.navigateTo({
					url: "/pages_homepage/shipin/shipin?id="+id+"&userid="+userid
				})
			},
			init(isPage, page) {
				let _this = this
				let url = "/api/user/hdrecordIndex"
				let data = {
					page: page || 1,
					limit: _this.limit,
				}
				httpRequest.request(url, 'GET', data, false, false, true).then(res => {
					if (res.code == 1) {
						let resList = res.data;
						let dataList = _this.list;
						if (isPage == true) {
							_this.list.data = dataList.data.concat(resList.data);
						} else {
							this.list = res.data
							_this.list.data = resList.data;
						}
					}
				}).catch(err => {
					httpRequest.toast(err.msg);
				})
			},
			onReachBottom() {
				let _this = this;
				let list = _this.list;
				let page = _this.page;
				if (list.last_page <= page) {
					return false;
				}
				page++;
				_this.page = page;
				_this.init(true, page);
			},
		}
	}
</script>

<style>

</style>
